{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Bootstrapping\n",
    "\n",
    "Example of bootstrapping the confidence interval for the mean of a sample distribution\n",
    "Since no bootstrapping is implemented in Python, this function requires\n",
    "\"bootstrap.py\", which is included.\n",
    "\n",
    "Note: The original scikits-bootstrapping module, which works only under\n",
    "Python 2, is available from http://github.org/cgevans/scikits-bootstrap\n",
    "   \n",
    "Author:  Thomas Haslwanter, Date:    Feb-2017"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import scipy as sp\n",
    "import matplotlib.pyplot as plt\n",
    "from scipy import stats\n",
    "import scikits.bootstrap as bootstrap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, 'Non-normally distributed dataset: Press any key to continue')"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEICAYAAAC6fYRZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADt0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjByYzIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy/EUOrgAAAgAElEQVR4nO29f5gc1XXn/TndPSNASPwQAxI/xfgHwSM2GIQ9xA5hbVgjBxu8u4mNsb2ECJnd7MbeTeI4JC+WiRcnefxmnbxOllerENsJErZjQ1jWIiavjTGJRmZkEzMylg0DEj8kEEIgIUAzPX3eP6qqVV1T1V096t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F8/B+Av48d/4CZzTOzM4E3EHxgM2tw999z91PdfSnBPH7b3T9EsX3eCTxpZmeFh94J/JgC+0ywTTNoZkeFef5Ogs+ciuxzRFs+hls6+8xsMIzVR2LXdJfp/uQ68Sn2uwm+ffIY8PvTbU+HfHo7wduyHwEPhT/vBhYB/x/ws/D38bFrfj+MwVYO0yfwXfT/Yg5+u6bQPgPnAsPhXN8JHDcHfP408BNgBPgbgm+VFMpnYD3BZw7jBHfkvz4VH4HlYZweA75A+B8Huv2jf2sghBAFZiZt1wghhOgwEnkhhCgwEnkhhCgwEnkhhCgwEnkhhCgwEnkhhCgwEnkhhCgw/z9YP5I+M+ooEAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Generate a non-normally distributed datasample\n",
    "data = stats.poisson.rvs(2, size=1000)\n",
    "\n",
    "# Show the data\n",
    "plt.plot(data, '.')\n",
    "plt.title('Non-normally distributed dataset: Press any key to continue')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The conficence intervals for the mean are: 1.932 - 2.108\n"
     ]
    }
   ],
   "source": [
    "# Calculate the bootstrap\n",
    "CIs = bootstrap.ci(data=data, statfunction=sp.mean)\n",
    "\n",
    "# Print the data: the \"*\" turns the array CIs into a list\n",
    "print('The conficence intervals for the mean are: {0} - {1}'.format(*CIs))"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
